<?php
/*
	Copyright 2006, 2007, 2008, 2009, 2010 Bastiaan Grutters
    
    This file is part of Ages of Strife website.

    Ages of Strife website is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Ages of Strife website is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Ages of Strife website.  If not, see <http://www.gnu.org/licenses/>.
 */
include( '../global/initialize.php' );

aos_header( 'Expedition' );
?>
					<div class="blok">
<?php
print_operations_tab( '' );
?>
					</div>
					<br />
<?php
include( "../global/resources.php" );

if( !isset( $_GET[ 'id' ] ) ) {
	$id = -1;	
}
else {
	$id = formatInput( $_GET[ 'id' ] );
}

$query = "SELECT * FROM expeditions WHERE expedition_id = '" . $id . "'";
$result = mysql_query( $query ) or die( "Query failed : " . mysql_error() );
$row = mysql_fetch_array($result, MYSQL_ASSOC);

if( isset( $row[ 'name' ] ) ) {
	print "<br /><table id= \"twothird\"><th colspan=\"2\">" . translate( $row[ 'name' ] ) . "</th>\r\n";
	
	print( "<tr><td>" . translate( 'Gold cost' ) . "</td><td><strong class=\"gold\">" . number_format( $row[ 'gold_cost' ] ) . "</strong></td></tr>\r\n" );
	print( "<tr><td>" . translate( 'Iron cost' ) . "</td><td><strong class=\"iron\">" . number_format( $row[ 'iron_cost' ] ) . "</strong></td></tr>\r\n" );
	print( "<tr><td>" . translate( 'Coal cost' ) . "</td><td><strong class=\"coal\">" . number_format( $row[ 'coal_cost' ] ) . "</strong></td></tr>\r\n" );
	print( "<tr><td>" . translate( 'Required recruits' ) . "</td><td><strong class=\"recruits\">" . number_format( $row[ 'recruit_cost' ] ) . "</strong></td></tr>\r\n" );
	print( "<tr><td>" . translate( 'Duration' ) . "</td><td>" . number_format( $row[ 'time_cost' ] ) . " " . translate( 'days' ) . "</td></tr>\r\n" );
	print "</table><br />\r\n";
	
	print( "<strong>Description</strong><br />\r\n" );
	print( "<pre>\r\n" );
	print( wordwrap( translate( $row[ 'description' ] ), 120 ) );
	print( "</pre>\r\n" );
}
else {
	print "<div class=\"blok\">\r\n";
	print translate( "No proper expedition id used." ) . "<br/>\r\n";
	print "</div><br/>\r\n";
}
mysql_free_result( $result );
mysql_close( $link );
?>
				</div>
			</div>
		</div>
	</body>
</html>